package com.kele.service.ExceptHandler.handler;

import com.kele.service.ExceptHandler.Exception.NameExpection;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

/**
 * 创作人 王箫凯
 * Date 2021/6/1
 * Time 20:51
 *
 * @author 王箫凯
 */
@ControllerAdvice
public class AllInformation {
//    @ExceptionHandler(value = NameExpection.class)
//    public ModelAndView mv(Exception ex){
//        ModelAndView view=new ModelAndView();
//        view.addObject("msg","未知错误");
//        view.addObject("ex",ex);
//        view.setViewName("error");
//        return view;
//    }
//    @ExceptionHandler
//    public ModelAndView modelAndView(Exception exception){
//
//        ModelAndView view = new ModelAndView();
//        view.addObject("msg","未知错误");
//        view.addObject("ex",exception);
//        view.setViewName("error");
//        return view;
//    }
}
